home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
answrbok
/
5_10.lha
/
5_10
/
5_10c5.c
< prev
next >
Wrap
Text File
|
1993-08-08
|
980b
|
39 lines
* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
* The C++ Answer Book */
* Tony Hansen */
* All rights reserved. */
/ Exercise 5.10
/ demonstration program showing the use
/ of the tableentry class
include <stream.h>
include <tableentry.h>
include "5_10c1.h" /* DELETE tableentry::tableentry() */
include "5_10c2.h" /* DELETE tableentry::~tableentry() */
include "5_10c3.h" /* DELETE tableentry::getvardata() */
include "5_10c4.h" /* DELETE tableentry::settype() */
ableentry namespace;
oid showvar(char *varname)
vardata *v;
int newvar = namespace.getvardata(varname, &v);
cout << "name='" << varname << "'\n";
cout << "\taddress=" << v->address << "\n";
cout << "\ttype=" << chr(v->type) << "\n";
if (newvar)
cout << "\tvariable is new\n";
ain(int,char**)
showvar("hello#");
showvar("there!");
showvar("howare#");
showvar("you");
showvar("hello#");
showvar("howare!");
showvar("you");
return 0;